#ifndef __DBCONNECTION_PFARM_H_
#define __DBCONNECTION_PFARM_H_

#include "Farm.h"

class PFarm : public Farm
{
	public:   
		PFarm(DbParam dbParameters, const char *readers, const char *writers, bool debug = false); 
		virtual MYSQL *GetReader();
		virtual MYSQL *GetWriter(int idx);
		virtual void CloseConnection(MYSQL *c, bool write = false) ; 
		virtual int GetWriterSize() { return writers_.size(); }
                virtual void Print();
		~PFarm();
// { closeAll(); }
	protected:
		bool initilize(const char *readers,const char *writers);
		void closeAll();
		MYSQL *getNextReader(int &num, int size);
		vector < PDbHost * > readers_;
		vector < PDbHost * > writers_;

};

#endif
